package com.lfg.leetcode.leetcode0;

public class No70climbStairs {

    public static void main(String[] args) {
//        String ret = simplifyPath("/a/b/c/d/f");
        int ret = climbStairs(3);
        System.out.println("[" + ret + "]");
    }

    public static int climbStairs(int n) {
        if (n <= 0) {
            return 0;
        }
        if (n < 2) {
            return 1;
        }
        int[] nums = new int[n];
        nums[0] = 1;
        nums[1] = 2;
        for (int i = 2; i < n; i++) {
            nums[i] = nums[i - 1] + nums[i - 2];
        }
        return nums[n - 1];
    }
}

